package com.xjrsoft.module.customerTwo.AppManage.test.service.impl;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.xjrsoft.core.tool.utils.StringUtil;
import com.xjrsoft.module.customerTwo.AppManage.test.entity.ErpFinanceexpenditure;
import com.xjrsoft.module.customerTwo.AppManage.test.dto.ErpFinanceexpenditureListDto;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.xjrsoft.common.page.ConventPage;
import com.xjrsoft.common.page.PageOutput;
import java.util.List;
import com.xjrsoft.module.customerTwo.AppManage.test.mapper.ErpFinanceexpenditureMapper;
import com.xjrsoft.module.customerTwo.AppManage.test.service.IErpFinanceexpenditureService;
import com.xjrsoft.core.mp.base.BaseService;
import com.xjrsoft.core.tool.utils.Func;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.core.metadata.IPage;

/**
 * 财政支出表 服务实现类
 *
 * @author dong
 * @since 2023-12-07
 */
@Service
@AllArgsConstructor
public class ErpFinanceexpenditureServiceImpl extends BaseService<ErpFinanceexpenditureMapper, ErpFinanceexpenditure> implements IErpFinanceexpenditureService {


	@Override
	public IPage<ErpFinanceexpenditure> getPageList(ErpFinanceexpenditureListDto pageListDto) {
		Wrapper<ErpFinanceexpenditure> wrapper = Wrappers.<ErpFinanceexpenditure>query().lambda()
				.like(!StringUtil.isEmpty(pageListDto.getF_AuditTime()), ErpFinanceexpenditure::getFAudittime, pageListDto.getF_AuditTime());
		return this.page(ConventPage.getPage(pageListDto), wrapper);
	}

	@Override
	public boolean addErpFinanceexpenditure(ErpFinanceexpenditure erpFinanceexpenditure) {
		boolean isSuccess = this.save(erpFinanceexpenditure);
		return isSuccess;
	}

	@Override
	public boolean updateErpFinanceexpenditure(String id, ErpFinanceexpenditure erpFinanceexpenditure) {
		erpFinanceexpenditure.setFId(id);
		return this.updateById(erpFinanceexpenditure);
	}

	public boolean delete(String ids) {
		List<String> idList = Func.toStrList(ids);
		if (this.removeByIds(idList)) {
			return true;
		}
		return false;
	}

}